	
    	function loadChannelUser(param){
    		if(param){
	    		$.ajax({
						url : "channelManagement/channelUserAction!queryList.action",
						type : 'POST',
						async : true,
						dataType:'json',
						contentType:"application/json",
						data:"{'pageBean':{'channel':'"+param.code+"'}}",
						error : function(XMLHttpRequest, textStatus, errorThrown) {
							if(errorThrown!=""){
								alert('系统出现异常！请联系管理员！');
							}
						},
						success : function(channelUser) {
							var list = channelUser.pageBean.listInfo;
							if(list){
								var buttonStr = "<a href='' onClick='delChannelUser(this);return false'>删除</a>";
								var tableContent = creatTable("user_Name,user_PassWord",channelUser,buttonStr);
								var tableObj = $("#channelUserTable");
								tableObj.find("tbody").remove();
								tableObj.append(tableContent);
							}
						}
					});
			}
    	}
    	
    	function delChannelUser(btn){
    		var delTr = $(btn).parent('td').parent('tr')[0];
			var value = delTr.childNodes[0].innerHTML;
			if(value){
				if(confirm('您确定要删除此行数据吗？')) {
				var channelcode = $("#channelCodeHidden")[0].value;
				var appId=$("#appIdHid").val();
				var jsonParame ="jsonParame={'user_Name':'"+value+"','fk_Channel_Code':'"+channelcode+"',"+"'appId':'"+appId+"'}";
					 $.ajax({
						url : "channelManagement/channelUserAction!delChannelUser.action",
						type : 'POST',
						dataType:'json',
						data:jsonParame,
						error : function(XMLHttpRequest, textStatus, errorThrown) {
							if(errorThrown!=""){
								alert('系统出现异常！请联系管理员！');
							}
						},
						success : function(saveResult) {
							alert(saveResult.pageBean.resultString);
							loadChannelUser({code:channelcode});
						}
					});	 
				}
			}
    	}
    	
    	function addChannelUser(param){
    		var texts = $("input[name='channelUserText']");
    		if(texts && texts.length ==2){
    			var userName = texts[0].value;
    			var password = texts[1].value;
    			userName = $.trim(userName);
    			password = $.trim(password);
    			if(!userName || !password){alert("数据不能为空"); return;}
    			var appId=$("#appIdHid").val();
    			var jsonParame ="jsonParame={'user_Name':'"+userName+"',"+"'user_PassWord':'"+password+"'," +
    					"'fk_Channel_Code':'"+param.code+"',"+"'appId':'"+appId+"'}";
    			$.ajax({
					url : "channelManagement/channelUserAction!addChannelUser.action",
					type : 'POST',
					dataType:'json',
					data:jsonParame,
					error : function(XMLHttpRequest, textStatus, errorThrown) {
						if(errorThrown!=""){
							alert('系统出现异常！请联系管理员！');
						}
					},
					success : function(addResult) {
						alert(addResult.pageBean.resultString);
						texts[0].value="";
						texts[1].value="";
						loadChannelUser(param);
					}
				});
    			
    		}
    	}
    	
    	function loadChannelTrans(param){
    		if(param){
    			$.ajax({
					url : "channelManagement/gatewayChannelTypeAction!queryList.action",
					type : 'POST',
					async : true,
					dataType:'json',
					contentType:"application/json",
					data:"{'pageBean':{'channel_Code':'"+param.code+"'}}",
					error : function(XMLHttpRequest, textStatus, errorThrown) {
						if(errorThrown!=""){
							alert('系统出现异常！请联系管理员！');
						}
					},
					success : function(gatewayChannelType) {
						var list = gatewayChannelType.pageBean.listInfo;
						if(list){
							
							var buttonStr = "<a href='' onClick='delChannelTrans(this);return false'>删除</a>";
							var infoStr ="transtype_Id@TDH,trans_Code,trans_Name";
							var tableContent = creatTable(infoStr,gatewayChannelType,buttonStr);
							var tableObj = $("#gatewayChannelTypeTable");
							tableObj.find("tbody").remove();
							tableObj.append(tableContent);
						}
					}
				});
    		}
    	}
    	
    	function delChannelTrans(btn){
    		var delTr = $(btn).parent('td').parent('tr')[0];
			var value = delTr.childNodes[0].innerHTML;
			var channelcode = $("#channelCodeHidden")[0].value;
			var transtype_Id=$(btn).parent().parent()[0].childNodes[0].innerHTML;
			if(value){
				if(confirm('您确定要删除此行数据吗？')) {
				var jsonStr ="{'pageBean':{'transid':'"+transtype_Id+"'}}";
					 $.ajax({
						url : "channelManagement/gatewayChannelTypeAction!deleteChannelType.action",
						type : 'POST',
    					async : true,
    					dataType:'json',
    					contentType:"application/json",
    					data:jsonStr,
    					error : function(XMLHttpRequest, textStatus, errorThrown) {
    						if(errorThrown!=""){
    							alert('系统出现异常！请联系管理员！');
    						}
    					},
						success : function(saveResult) {
							alert(saveResult.pageBean.resultString);
							method({str:"loadChannelTrans"});
						}
					});	 
				}
			}
    	}
    	
    	function loadChannelIp(param){
    		if(param){
	    		$.ajax({
						url : "channelManagement/channelIpAction!queryList.action",
						type : 'POST',
						async : true,
						dataType:'json',
						contentType:"application/json",
						data:"{'pageBean':{'channel':'"+param.code+"'}}",
						error : function(XMLHttpRequest, textStatus, errorThrown) {
							if(errorThrown!=""){
								alert('系统出现异常！请联系管理员！');
							}
						},
						success : function(channelIp) {
							var list = channelIp.pageBean.listInfo;
							if(list){
								var buttonStr = "<a href='' onClick='delChannelIp(this);return false'>删除</a>";
								var tableContent = creatTable("ip_Des",channelIp,buttonStr);
								var tableObj = $("#channelIpTable");
								tableObj.find("tbody").remove();
								tableObj.append(tableContent);
							}
						}
					});
			}
    	}
    	
    	function delChannelIp(btn){
    		var delTr = $(btn).parent('td').parent('tr')[0];
			var value = delTr.childNodes[0].innerHTML;
			if(value){
				if(confirm('您确定要删除此行数据吗？')) {
				var channelcode = $("#channelCodeHidden")[0].value;
				var appId=$("#appIdHid").val();
				var jsonParame ="jsonParame={'ip_Des':'"+value+"','fk_Channel_Code':'"+channelcode+"',"+"'appId':'"+appId+"'}";
					 $.ajax({
						url : "channelManagement/channelIpAction!delChannelIp.action",
						type : 'POST',
						dataType:'json',
						data:jsonParame,
						error : function(XMLHttpRequest, textStatus, errorThrown) {
							if(errorThrown!=""){
								alert('系统出现异常！请联系管理员！');
							}
						},
						success : function(saveResult) {
							alert(saveResult.pageBean.resultString);
							loadChannelIp({code:channelcode});
						}
					});	 
				}
			}
    	}
    	
    	
    	function addChannelIp(param){
    		var ipValue = $("#channelIpText")[0].value;
    		if(!ipValue){alert("请输入的IP"); return;}
    		ipValue = $.trim(ipValue);
    		var strReg=/^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$/;
    		var result = ipValue.match(strReg);
    		if(result == null){alert("您输入的IP "+ipValue+" 格式不正确！");$("#channelIpText")[0].focus();return;}	
    		var appId=$("#appIdHid").val();
    		var jsonParame ="jsonParame={'ip_Des':'"+ipValue+"'," +
    				"'fk_Channel_Code':'"+param.code+"',"+"'appId':'"+appId+"'}";
    			$.ajax({
					url : "channelManagement/channelIpAction!addChannelIp.action",
					type : 'POST',
					dataType:'json',
					data:jsonParame,
					error : function(XMLHttpRequest, textStatus, errorThrown) {
						if(errorThrown!=""){
							alert('系统出现异常！请联系管理员！');
						}
					},
					success : function(addResult) {
						alert(addResult.pageBean.resultString);
						$("#channelIpText")[0].value="";
						loadChannelIp(param);
					}
				});
    	}
    	
    	function addChannelTrans(param){
    		var transCode=$("#transCodeText")[0].value;
    		var transName=$("#transNameText")[0].value;
    		var channelcode = $("#channelCodeHidden")[0].value;
    		if(!transCode){alert("请输入交易代码");return;}
    		if(!transName){alert("请输入交易名称");return;}
    		transCode=$.trim(transCode);
    		transName=$.trim(transName);
    		var jsonStr ="{'pageBean':{'trxCode':'"+transCode+"',"+"'transName':'"+transName+"'," +
			"'channel_Code':'"+param.code+"'}}";
    		if(confirm('您确定要增加此行数据吗？')) {
	    		$.ajax({
					url : "channelManagement/gatewayChannelTypeAction!addChannelType.action",
					type : 'POST',
					async : true,
					dataType:'json',
					contentType:"application/json",
					data:jsonStr,
					error : function(XMLHttpRequest, textStatus, errorThrown) {
						if(errorThrown!=""){
							alert('系统出现异常！请联系管理员！');
						}
					},
					success : function(addResult) {
						alert(addResult.pageBean.resultString);
						$("#transCodeText")[0].value="";
						$("#transNameText")[0].value="";
						method({str:"loadChannelTrans"});
					}
				});
    		}
    	}
				  	
    	function loadChannelMapping(param){
    		if(param){
    			 var jsonDate = "{'pageBean':{'displayPages':'1','pageSize':'10','channel':'"+param.code+"'}}";
    			 var startP = 1;
//    			 if(param.displayPages){
//    				jsonDate = "{'pageBean':{'displayPages':'"+param.displayPages+"','pageSize':'10','channel':'"+param.code+"'}}";
//    				startP = param.displayPages;
//    			 }
    			// if(param.txCode  || param.channelComCode || param.makeChannel || param.productCode ||  param.region || param.operator){
    			 if(param.displayPages){	 
    				 startP = param.displayPages;
    				 jsonDate = "{'pageBean':{'displayPages':'"+param.displayPages+"','pageSize':'10','channel':'"+param.code+"','txCode':'"+param.txCode+"','channelComCode':'"+param.channelComCode+"','makeChannel':'"+param.makeChannel+"','productCode':'"+param.productCode+"','region':'"+param.region+"','operator':'"+param.operator+"'}}";
    			 }
	    		$.ajax({
						url : "channelManagement/channelMappingAction!queryList.action",
						type : 'POST',
						async : true,
						dataType:'json',
						contentType:"application/json",
						data:jsonDate,
						error : function(XMLHttpRequest, textStatus, errorThrown) {
							if(errorThrown!=""){
								alert('系统出现异常！请联系管理员！');
							}
						},
						success : function(channelMapping) {
							var list = channelMapping.pageBean.listInfo;
							if(list){
								var buttonStr = "<a href='' onClick='delChannelMappping(this);return false'>删除</a>";
								var infoStr ="mappingId@TDH,channelCode,productCode,txCode,region,channelComCode,operator,makeChannel,fieldName,fieldValue,mapping_Priority";
								var tableContent = creatTable(infoStr,channelMapping,buttonStr);
								var tableObj = $("#channelMappingTable");
								tableObj.find("tbody").remove();
								tableObj.append(tableContent);
								//$("#channelCodeTd")[0].innerHTML=param.code;
								var strPage = creatChannelPage(startP,6,channelMapping.pageBean.pages,"2");
								var mappingPageDIV = $("#mappingPageDIV");
								mappingPageDIV[0].innerHTML="";
								mappingPageDIV.append(strPage); 
							}
						}
					});
			}
    	}
    	
    	function delChannelMappping(btn){
    		var delTr = $(btn).parent('td').parent('tr')[0];
			var value = delTr.childNodes[0].innerHTML;
			if(value){
				if(confirm('您确定要删除此行数据吗？')) {
				var channelcode = $("#channelCodeHidden")[0].value;
				var jsonParame ="jsonParame={'mappingId':'"+value+"'}";
					 $.ajax({
						url : "channelManagement/channelMappingAction!delChannelMapping.action",
						type : 'POST',
						dataType:'json',
						data:jsonParame,
						error : function(XMLHttpRequest, textStatus, errorThrown) {
							if(errorThrown!=""){
								alert('系统出现异常！请联系管理员！');
							}
						},
						success : function(saveResult) {
							alert(saveResult.pageBean.resultString);
							loadChannelMapping({code:channelcode});
						}
					});	 
				}
			}
    	}
    	
    	function loadAppInfo2(appid){
			$.ajax({
					url : "appManager/queryList",
					type : 'POST',
					async : true,
					dataType:'json',
					error : function(XMLHttpRequest, textStatus, errorThrown) {
						if(errorThrown!=""){
							alert('系统出现异常！请联系管理员！');
						}
					},
					success : function(appList) {
						var list = appList;
						if(list){
							var appInfoSel= $("#channelAppSel");
							var l = appInfoSel[0].childNodes.length;
							for(var j=0;j<l;j++){
								appInfoSel[0].remove(0);
							}
							var strOption ="<option value=''>--请选择--</option>";
							for(var i=0;i<list.length;i++){
								if(list[i].appid == appid){
									strOption += "<option value='"+list[i].appid+"' selected>"+list[i].appname+"</option>";
								}else{
									strOption += "<option value='"+list[i].appid+"'>"+list[i].appname+"</option>";
								}
							}
							 appInfoSel.append(strOption); 
						}
					}
				});
		}
    	
    	function updateChannelAppId(){
    		var appInfoSel= $("#channelAppSel");
    		var oldAppId = $("#appIdHid").val();
    		var channelCode = $("#channelCodeText").val();
    		var appName = appInfoSel.find("option:selected").text();
    		var appId = appInfoSel.val();
    		if(!appId){appName="空";}
    		if(oldAppId != appId){
    			if(confirm('您确定要将 '+channelCode+' 渠道归属至 '+appName+' 网关接口吗？')) {
    			$("#appIdHid")[0].value=appInfoSel.val();
	    			if(channelCode && appInfoSel){
	    				$.ajax({
	    					url : "channelManage/updateChannelAppId",
	    					type : 'POST',
	    					dataType:'text',
	    					data:{
	    						channelCode:channelCode,
	    						appId:appId
	    					},
	    					error : function(XMLHttpRequest, textStatus, errorThrown) {
	    						if(errorThrown!=""){
	    							alert('系统出现异常！请联系管理员！');
	    						}
	    					},
	    					success : function(updateResult) {
	    						if(updateResult == "success"){
	    							alert("更新成功");
	    						}
	    					}
	    				});
	    			}
    			}
    		}else{
    			alert("您未作任何修改");
    		}
    		
    	}
    	
    	
    	